<?
require_once('Nbbc/nbbc.php');


class StringUtils{
	private static $bbCodeInstance;
	
	public static function bbCodeinstance(){
		if (!self::$bbCodeInstance){
			self::$bbCodeInstance = new BBCode();
			return self::$bbCodeInstance;
		}else{
			return self::$bbCodeInstance;
		}
	}
	
	// CKEditor code for text editor
	public static function CKEditor($fieldName, $fieldValue, $toolbar = "User", $width = "99%", $height = 20){
		include(dirname(__FILE__).'/../Ckeditor/ckeditor.php');
	
		$CKEditor = new CKEditor();
		$CKEditor->basePath = '/library/Ckeditor/';
		
		// Do not print the code directly to the browser, return it instead
		$CKEditor->returnOutput = true;
	
		// set the graphical look of CKEditor
		//$config['skin'] = 'office2003';   // default skin is -> kama   -->  available skins: kama, office2003, v2  --- uncomment line to use
		// User Interface Color, works only on default skin: kama
		$config['uiColor'] = '#AABBCC';  // User Interface Color ... sets CKEditor's toolbar gradient color
		// set up Width and Height of CKEditor
		$config['width'] = $width;  // width can be set to pixels or percentage... For Example:  $config['width'] = 600;  -OR- $config['width'] = '90%';
		$config['height'] = $height * 17;
	
		if ($toolbar == 'Basic')
			$config['toolbar'] = array(
		       array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ),
		       array( 'Image', 'Link', 'Unlink', 'Anchor' )
		    );
	
	   // Create editor instance.
	  return $CKEditor->editor($fieldName, $fieldValue, $config);
	}
}

?>